﻿<?php
require_once(dirname(__FILE__)."/../../libs/login/login.php"); 
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/shuxing_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$sx=new shuxing();
$tb="nianji_class";
if($_GET["sx"]=='nianji'){
	$tb="nianji_class";
}
if($_GET["sx"]=='xueke'){
	$tb="xueke_class";
}

$getrs=$sx->getshuxinglist($tb);
//删除一个属性
echo $_GET["del"];
if($mc->Ismp($_GET["del"]!="")){
	$sx->deleteshuxing($tb,$_GET["del"]);
	$mc->msg("","shuxing_class.php?sx=".$_GET['sx']);	
	
}



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="../js/jquery.js"></script>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 

<div class="content">
    <div class="right">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1%" align="right"><img src="../images/weizhleft.png" width="12" height="45" /></td>
            <td width="98%" style="background:url(../images/weizhimid.png) repeat-x"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="87%"><?php echo $path;?></td>
                <td width="13%"><Div class="xuanxiang"><input type="button" name="button" id="button" value="添加新类" onclick="location.href='shuxing_add.php?sx=<?php echo $_GET["sx"]?>'"/></Div></td>
              </tr>
           
            </table></td>
            <td width="1%" align="right" ><img src="../images/weizhiright.png" width="12" height="45" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="bg">
         <tr>
            <td valign="middle" bgcolor="#f1fbff" style="border-bottom:1px solid #c3e1ee; padding:10px 0 10px 10px;">
              <div class="xuanze2"><form method="GET" action="" id="shuxing"><select name="sx" onchange="$('#shuxing').submit()">
                <option value="nianji" <?php if($_GET['sx']=="nianji"){?>selected<?php }?> >年级</option><option value="xueke" <?php if($_GET['sx']=="xueke"){?>selected<?php }?>>学科</option></select>
               
              </form></div></td>
          </tr>
         </table></td>
         </tr> 
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="bg">
          <tr>
            <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"  class="line">
              <thead style="background:url(../images/titlebg.jpg) repeat-x;font-family:'微软雅黑'; font-weight:normal; font-size:13px; color:#659200;">
              	<tr>
                	<th height="35" colspan="2" align="left" style="padding-left:1%; ">分类</th>
                    <th width="25%" colspan="-4" align="center"><strong>排序</strong></th>
                    <th width="25%" colspan="-3" align="center">编辑</th>
                </tr>
              </thead>
              <tbody>
              <?php foreach($getrs as $rs){?>
              	<tr>
                	<td width="1%" height="40" align="center">&nbsp;</td>
                	<td width="49%" height="40" align="left"><?php echo $rs["classname"]?></td>
                    <td height="40" colspan="-4" align="center"><input name="classorder<?php echo  $rs["classorder"];?>" value="<?php echo $rs["classorder"];?>" style="border:1px solid #ccc; width:20px; text-align:center"></td>
                    <td height="40" colspan="-3" align="center">
                    <bdo><input type="submit" name="button2" id="button2" value="修改" onclick="location.href='shuxing_edit.php?id=<?php echo $rs["ID"];?>&sx=<?php echo $_GET["sx"];?>'"/></bdo>
                      <bdo><input type="submit" name="button3" id="button3" value="删除" onclick="if(confirm('您确定删除本项吗?')){location.href='?del=<?php echo $rs["ID"];?>&sx=<?php echo $_GET["sx"];?>'}"/>
                    </bdo></td>
                </tr>
     <?php }?>
              </tbody>
            </table>
            </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    
    </div>
</div>
</body>
</html>